import React, { Component } from 'react';
import { NavLink } from 'react-router-dom'
import { Route,Redirect } from 'react-router-dom'
import Offer from './Offer'
import Position from './Position'
import Nationwide from './Nationwide'
import Screen from './Screen'

class Side extends Component {
    constructor(props) {
        super(props);
        this.state = {
            Classify:[
                {
                    "id":"0",
                    "text":"悬赏",
                    "link":"/abilitysson/offer"
                  },
                  {
                    "id":"1",
                    "text":"职位",
                    "link":"/abilitysson/position"
                  },
                  {
                    "id":"3",
                    "textz":"全国",
                    "link":"/nationwide"
                  },
                  {
                    "id":"4",
                    "textz":"筛选",
                    "link":"/screen"
                  }
            ],
            
            i:0,
        }
    }
    render() {
        return (
            <div className="side">
                <div className="btns">
                {
                    this.state.Classify.map((item,index)=>{
                        return (
                            <NavLink key={index} to={ item.link }> {item.text} </NavLink>
                            
                            
                        )
                    })
                }
                </div>
                <div className="btnsz">
                {
                    this.state.Classify.map((item,index)=>{
                        return (
                            <NavLink key={index} to={ item.link }> {item.textz} </NavLink>
                            
                            
                        )
                    })
                }
                </div>
                <Route path="/abilitysson/offer" exact component={ Offer }></Route>
                <Route path="/abilitysson/position" exact component={ Position }></Route>
                <Redirect from="/abilitysson" to="/abilitysson/offer"></Redirect>
            </div>
        );
    }
}

export default Side;